﻿using System.Collections.Generic;
using SCResources.General;
using SCResources.ImdbSerieService;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using HtmlAgilityPack;

namespace UnitTests
{
    
    
    /// <summary>
    ///This is a test class for ServicesTest and is intended
    ///to contain all ServicesTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ServicesTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        ///// <summary>
        /////A test for GetImageUrl
        /////</summary>
        //[TestMethod()]
        //[DeploymentItem("SCResources.dll")]
        //public void GetImageUrlTest()
        //{
            
        //    Services_Accessor target = new Services_Accessor(); 
        //    ImdbServices test = new ImdbServices();
        //    test.GetSerieCover("1592154");

        //    HtmlDocument H = new HtmlDocument();
        //    H.LoadHtml(html);

        //    string expected =
        //        "http://ia.media-imdb.com/images/M/MV5BMjIxMDAyOTMzMV5BMl5BanBnXkFtZTcwMjE5NTc4NA@@._V1._SY317_CR11,0,214,317_.jpg";
        //    string actual;
        //    actual = target.GetImageUrl(H);
        //    Assert.AreEqual(expected, actual);
        //    //Assert.Inconclusive("Verify the correctness of this test method.");
        //}

        /// <summary>
        ///A test for GetAirdates
        ///</summary>
        [TestMethod()]
        [DeploymentItem("SCResources.dll")]
        public void GetAirdatesTest_Check_through_Debug()
        {

            
            ImdbServices test = new ImdbServices();
            List<DateTime> dates;
            dates = test.GetSerieAirdates("1592154", 2);

            dates.Sort();

            List<string> actual = new List<string>();
            

            //Assert.AreEqual(actual, actual);

        }

        /// <summary>
        ///A test for GetNextAirdate
        ///</summary>
        [TestMethod()]
        [DeploymentItem("SCResources.dll")]
        public void GetNextAirdateTest()
        {
            ImdbServices test = new ImdbServices();
            SerieAirInfo next;

            next = test.GetNextAirdate("1592154", 1); // season 2 will give an airdate (@ 06/04/2012)
        }

        /// <summary>
        ///A test for GetLastSeasonNumber by BreakPoint
        ///</summary>
        [TestMethod()]
        [DeploymentItem("SCResources.dll")]
        public void GetLastSeasonNumber()
        {
            ImdbServices test = new ImdbServices();


            test.GetLastSeasonNumber("1592154");
        }
    }
}
